import fetch from 'common/src/utils/fetch';
import UTILS from "common/src/utils/utils";

// 选课结果统计
function graduateElectionResultsExport(data) {
    return fetch({
        url: '/api/electionservice/elcResult/elcResultCountByStudentExport',
        method: 'post',
        data: data
    });
}
function noSelectNum(data){
    return fetch({
        url: '/api/electionservice/elcResult/elcResultNonSelectedStudent',
        method: 'post',
        data: data
    });
}
//选课结果导出请求的导出
 function selectResultExport(params){
    let query = '?';
    for (let key in params) {
        query += key;
        query += '=';
        query += params[key];
        query += '&';
    }
     return '/api/electionservice/elcResult/elcResultCountByStudentExport'+query.substring(0, query.length - 1)
 }
//get导出选课结果

//未选课学生导出
function noSelectResultExport(params){
    let query = '?';
    for (let key in params) {
        query += key;
        query += '=';
        query += params[key];
        query += '&';
    }
    return '/api/electionservice/elcResult/export'+query.substring(0, query.length - 1)
}

//选课统计结果导出获取地址
function getExportUrl(key){
    return fetch({
        url: '/api/electionservice/elcResult/result/'+key,
        method: 'get',
    
    });
}
export default {
    graduateElectionResultsExport:graduateElectionResultsExport,
    graduateElectionResults:'/api/electionservice/elcResult/elcResultCountByStudent',
    selectResultExport,
    noSelectNum,
    getExportUrl,
    noSelectResultExport
}